Query processing using matrix and reduced predicate statements

ABSTRACT

A query processing system applies transforms to convert a collection of predicate statements to two parts, a matrix and a set of reduced predicate statements, and evaluates the matrix and reduced predicate statements when querying data. The query processing system applies the transforms to extract conjunctive predicates or disjunctive predicates from the predicate statements to provide the set of reduced predicate statements and generates the matrix using the extracted conjunctive predicates or disjunctive predicates. When data is received for querying, the query processing system evaluates the matrix and reduced predicate statements for the data to provide search results. The query processing system may first identify candidate predicate statements that may be satisfied for the data from the matrix and then evaluates the reduced predicate statements for those candidate predicate statements.

CROSS-REFERENCE TO RELATED APPLICATIONS

This patent application is related by subject matter to: U.S. patentapplication Ser. No. 16/777,412, titled QUERY PROCESSING USING HYBRIDINVERTED INDEX OF PREDICATES, filed on even date herewith; and U.S.patent application Ser. No. 16/777,399, titled QUERY PROCESSING USINGINVERTED INDEX OF PREDICATE STATEMENTS , filed on even date herewith.Each of the aforementioned applications is incorporated herein byreference in its entirety.

BACKGROUND

As the amount of available digital information continues to growexponentially, search techniques have become paramount for quickly andefficiently querying information. For some domains, query processing isperformed by expressing queries using a set of predicate statements andevaluating the predicate statements for data being queried. In somecases, tens of thousands of predicate statements are generated bymachine learning that need to be evaluated at run time. Given the largenumber of evaluations that need to be performed, it is an expensiveoperation in terms of processing requirements for conventional queryprocessing systems to completely and accurately perform theseevaluations and difficult for the conventional query processing systemsto return results in an acceptable amount of time.

SUMMARY

Embodiments of the present invention relate to, among other things, aquery processing system that applies transforms to convert a collectionof predicate statements to two parts, a matrix and a set of reducedpredicate statements, and evaluates the matrix and reduced predicatestatements when querying data. The query processing system applies thetransforms to extract conjunctive predicates or disjunctive predicatesfrom the predicate statements to provide the set of reduced predicatestatements and generates the matrix using the extracted conjunctivepredicates or disjunctive predicates. When data is received forquerying, the query processing system evaluates the matrix and reducedpredicate statements for the data to provide search results. The queryprocessing system may first identify candidate predicate statements thatmay be satisfied for the data from the matrix and then evaluates thereduced predicate statements for those candidate predicate statements.The transforms applied by the query processing system are idempotentsuch that results of evaluation of data using the matrix and reducedpredicate statements are identical to results of evaluation of the datausing the original predicate statements.

This summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used as an aid in determining the scope of the claimed subjectmatter.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is described in detail below with reference to theattached drawing figures, wherein:

FIG. 1 is a block diagram illustrating an exemplary system in accordancewith some implementations of the present disclosure;

FIG. 2 is a block diagram showing transformation of a collection ofpredicate statements to a matrix and reduced predicate statement form inaccordance with some implementations of the present disclosure;

FIG. 3 is a flow diagram showing a method for transforming a collectionof predicate statements in accordance with some implementations of thepresent disclosure;

FIG. 4 is block diagram showing an example of a tree generated from apredicate statement;

FIG. 5 is a flow diagram showing a method for query processing using acollection of predicate statements in matrix and reduced predicatestatement form in accordance with some implementations of the presentdisclosure; and

FIG. 6 is a block diagram of an exemplary computing environment suitablefor use in implementations of the present disclosure.

DETAILED DESCRIPTION Definitions

Various terms are used throughout this description. Definitions of someterms are included below to provide a clearer understanding of the ideasdisclosed herein.

As used herein, a “predicate” refers to a condition to be evaluated aseither “true” when the condition is satisfied or “false” when thecondition is not satisfied. A predicate can generally be represented as:LHS OPERATOR RHS, where LHS refers to a left-hand side that is a“variable,” RHS refers to a right-hand side that is a “predicate value”that can be a constant or a predicate value for the variable, andOPERATOR refers a “predicate operator” for comparing the LHS and RHS.Predicator operators includes: <, <=, =, !=, >, and >=. Shown below area few examples of predicates to illustrate:

-   -   1) r<=10, where “r” is a variable, <= is an operator, and 10 is        a predicate value that is a constant.    -   2) state=‘CA’, where “state” is a variable, = is an operator,        and ‘CA’ is a predicate value that is a constant.    -   3) x>y, where “x” is a variable, > is an operator, and “y” is a        predicate value that is a variable.

A “predicate statement” joins individual predicates using logicaloperators, which may be Boolean operators, such as AND, OR, and NOT.Provided below is an example of a predicate statement combining theabove predicates (parenthesis are included to assist in readability):

((r<=10) OR (x>y)) AND (state=‘CA’)

As used herein, a “predicate statement identifier” refers to anidentifier assigned to a predicate statement to uniquely identify thepredicate statement. For instance, the predicate statement identifierassigned to each predicate statement from a collection of predicatestatements can be a sequential number.

A “predicate statement tree” or “tree” is a tree expression of apredicate statement in which each leaf node corresponds with a predicatefrom the predicate statement and each intermediate node corresponds witha logical operator from the predicate statement.

A “node identifier” refers to an identifier assigned to each predicateand each logical operator in a predicate statement.

A “predicate identifier” refers to an identifier that uniquelyidentifies a predicate in a collection of predicate statements. In someconfigurations, a predicate identifier used to uniquely identify apredicate can be a combination of a predicate statement identifier forthe predicate statement containing the predicate and the node identifierassigned to the predicate.

As used herein, “conjunctive normal form” (CNF) for a predicatestatement indicates that the predicate statement is expressed as aconjunction (i.e., logical AND) of several predicate subexpressionswhere each predicate subexpression is devoid of any conjunctionoperator. Below is an example of a predicate statement in CNF:

(r<=10 OR x<y) AND (state=‘CA’)

In this example, the predicate statement includes two predicatesubexpressions: (r<=10 OR x<y) and (state=‘CA’), and each subexpressionis devoid of any conjunction operator.

As used herein, “disjunctive normal form” (DNF) for a predicatestatement indicates that the predicate statement is expressed as adisjunction (i.e., logical OR) of several predicate subexpressions whereeach predicate subexpression is devoid of any disjunction operator.Below is an example of a predicate statement in DNF:

(a<10 AND score>0.9) OR (state=‘CA’ AND gender=‘Male’)

In this example, the predicate statement includes two predicatesubexpressions: (a<10 AND score>0.9) and (state=‘CA’ AND gender=‘Male’),and each subexpression is devoid of any disjunction operator.

OVERVIEW

Query processing for many domains is often accomplished by conventionalquery processing systems expressing queries using a set of predicatestatements and evaluating the predicate statements against data beingqueried. Each predicate statement includes one or more predicates, andeach predicate represents a condition to be evaluated. The goal of suchquery processing systems is to provide evaluations that are accurate,complete, and performed in a short period of time (e.g., a fewmilliseconds). Although each predicate statement can be sequentiallyevaluated for a truth value, when a large number of predicate statementsare involved, the evaluation process can be both resource and timeintensive for the query processing system. Some approaches, such as theRETE algorithm, have been developed to facilitate the evaluation processbut still include drawbacks in resource requirements (includingprocessing and memory requirements) and the time required for the queryprocessing systems to process the queries.

Embodiments of the present invention are directed to a query processingsystem that addresses these challenges by providing a solution thatefficiently evaluates predicate statements for query processing. Given acollection of predicate statements, the query processing system appliesone or more transforms to convert the predicates statements into twoparts: (1) a matrix, and (2) a set of reduced predicate statements. Thetransforms applied are idempotent in that results of evaluation of datausing the matrix and reduced predicate statements is identical toresults of evaluation of the data using the original predicatestatements.

The transforms applied to predicate statements operate to extractconjunctive predicates (when the predicate statements are in CNF) ordisjunctive predicates (when the predicate statements are in DNF) fromthe predicate statements to form the reduced predicate statements. Thematrix is generated by including a row for each predicate statement anda column for each variable included in the predicate statements. Eachconjunctive/disjunctive predicate extracted from the predicatestatements are added to the matrix in the row for the predicatestatement from which the conjunctive/disjunctive predicate was extractedand in the column for the variable included in theconjunctive/disjunctive predicate.

When input data is to be queried, the query processing system evaluatesthe matrix and set of reduced predicate statements for the input data.In some configurations, the query processing system initially identifieswhich predicate statements can be satisfied for the input data from thematrix. These are considered as candidate predicate statements. Thereduced predicate statements for the candidate predicate statements arethen evaluated for the input data. For each reduced predicate statementthat evaluates to true based on the input data, the correspondingpredicate statement is marked as true, thereby providing a result set ofpredicate statements that evaluate to true for the input data.

The query processing system described herein provides a number ofadvantages over conventional systems. Due to the regular structure ofthe matrix, evaluation to identify candidate predicate statements fromthe matrix can be performed very quickly and efficiently. For instance,in the case of conjunctive predicates, the process is a simple ANDing ofthe conjunctive predicates. Additionally, the reduced predicatestatements have lower complexity as compared to the original predicatestatements, making evaluation of those reduced predicate statementsquicker and more efficient. Further, reduced predicate statements areevaluated only for candidate predicate statements identified from thematrix. This is in contrast to conventional systems in which eachpredicate statement is evaluated. Accordingly, the query processingsystem provides for evaluation of predicate statements that is not onlyfaster than conventional systems but also more efficient, therebyreducing computing resources requirements to perform query processing.

Query System Using Transformed Predicate Statements

With reference now to the drawings, FIG. 1 is a block diagramillustrating an exemplary system 100 for query data by transforming acollection of predicate statements into matrix and reduced expressionform in accordance with implementations of the present disclosure. Itshould be understood that this and other arrangements described hereinare set forth only as examples. Other arrangements and elements (e.g.,machines, interfaces, functions, orders, and groupings of functions,etc.) can be used in addition to or instead of those shown, and someelements may be omitted altogether. Further, many of the elementsdescribed herein are functional entities that may be implemented asdiscrete or distributed components or in conjunction with othercomponents, and in any suitable combination and location. Variousfunctions described herein as being performed by one or more entitiesmay be carried out by hardware, firmware, and/or software. For instance,various functions may be carried out by a processor executinginstructions stored in memory.

The system 100 is an example of a suitable architecture for implementingcertain aspects of the present disclosure. Among other components notshown, the system 100 includes query device 102, which includes atransformation module 104, and an evaluation module 106. The querydevice 102 shown in FIG. 1 can comprise a computer device, such as thecomputing device 600 of FIG. 6 , discussed below. While the query device102 is shown as a single device in FIG. 1 , it should be understood thatthe query device 102 may comprise multiple devices cooperating in adistributed environment. For instance, the query device 102 could beprovided by multiple server devices collectively providing thefunctionality of the query device 102 as described herein. Additionally,other components not shown may also be included within the networkenvironment. When multiple devices are employed, the devices cancommunicate via a network (not shown), which may include, withoutlimitation, one or more local area networks (LANs) and/or wide areanetworks (WANs). Such networking environments are commonplace inoffices, enterprise-wide computer networks, intranets, and the Internet.It should be understood that any number of devices and networks may beemployed within the system 100 within the scope of the presentinvention.

At a high level, the query device 102 generally operates to transform acollection of predicate statements 108 into a matrix and reducedpredicate statement form, which is used for evaluating the predicatestatements when querying input data. Among other components not shown,the query device includes a transformation module 104 and evaluationmodule 106.

The transformation module 104 operates to transform the collection ofpredicate statements 108 into a matrix and reduced predicate statementform. One approach for the transformation module 104 to transformpredicate statements is described in more detail below with reference toFIG. 3 . Initially, the transformation module 104 may perform one ormore preprocessing operations on the predicate statements 108. Forinstance, the transformation module 104 may convert at least a portionof the predications statements 108 into CNF or DNF such that eachpredicate statement is in CNF or DNF.

The preprocessing operations may further include assigning a predicatestatement identifier to each predicate statement from the collection ofpredicate statements 108. Additionally, for each predicate statement,the transformation module 104 may assign a node identifier to eachpredicate and each logical operator. In some configurations, this mayinclude representing the predicate statement as tree with each leaf nodecorresponding to a predicate and each intermediate node corresponding toa logical operator. The edges between nodes in the tree are structuredbased on the relationships among predicates and logical operators in thepredicate statement. A combination of a predicate statement identifierand node identifier can be used to uniquely identify predicates andlogical operators among the collection of predicate statements 108. Forinstance, a predicate identifier uniquely identifying a predicate can bebased on a combination of a predicate statement identifier for thepredicate statement in which the predicate is located and a nodeidentifier for the predicate.

After any preprocessing is performed, the transformation module 104performs one or more idempotent transformations on the predicatestatements 108 to convert the predicate statements to two parts: a firstpart comprising a matrix and a second part comprising a reducedpredicate statement for each predicate statement from the collection ofpredicate statements. This transformation is illustrated in FIG. 2 , inwhich a collection of predicate statements 202 is transformed into amatrix 204 and a set of reduced predicate statements 206.

In instances in which the predicate statements 108 are in CNF, thetransformation module 104 applies transformations to generate a matrixcontaining conjunctive predicates from each predicate statement. Eachrow of the matrix corresponds with a predicate statement and each columncorresponds with a variable. Each conjunctive predicate from a predicatestatement is added to the row for the predicate statement and the columnbased on the variable of the predicate statement. Additionally, thetransformations provide a reduced predicate statement for each predicatestatement by removing any conjunctive predicates added to the matrixfrom a predicate statement. In instances in which the predicatestatements are in DNF, the transformation module 104 appliestransformations to generate a matrix containing disjunctive predicatesfrom each predicate statement and reduced predicate statements in whichdisjunctive predicates added to the matrix have been removed from thepredicate statements.

The evaluation module 106 employs the matrix and reduced predicationstatement form generated by the transformation module 104 to evaluatepredicate statements for input data 112 in order to provide queryresults 114. One approach for the evaluation module 106 to evaluatepredicate statements for input data are described in detail below withreference to FIG. 5 .

In accordance with some configurations, the evaluation module 106 firstemploys the matrix to identify candidate predicate statements that canbe satisfied for the input data. More particularly, each conjunctivepredicate or disjunctive predicate in the matrix for a given predicatestatement is evaluated for the input data. If satisfied for a givenpredicate statement, the predicate statement is considered a candidatefor further evaluation. Otherwise, if unsatisfied for a given predicatestatement, the predicate statement is not further evaluated.

The evaluation module 106 evaluates the reduced predicate statement foreach candidate predicate statement identified from the matrix. For eachreduced predicate statement that evaluates to true based on the inputdata, the corresponding predicate statement is marked as true, therebyproviding a result set of predicate statements that evaluate to true forthe input data, and query results 114 are provided based on thisevaluation process.

Predicate Statement Transformation

With reference now to FIG. 3 , a flow diagram is provided thatillustrates a method 300 for transforming a collection of predicatestatements. The method 300 may be performed, for instance, by thetransformation module 104 of FIG. 1 . The method 300 may be performedfor each predicate statement in a collection of predicate statements tobe evaluated. Each block of the method 300 and any other methodsdescribed herein comprises a computing process performed using anycombination of hardware, firmware, and/or software. For instance,various functions can be carried out by a processor executinginstructions stored in memory. The methods can also be embodied ascomputer-usable instructions stored on computer storage media. Themethods can be provided by a standalone application, a service or hostedservice (standalone or in combination with another hosted service), or aplug-in to another product, to name a few.

As shown at block 302, a collection of predicate statements areaccessed. The collection of predicate statements generally comprisesexpressions that are used for querying data. The predicate statementscan comprise multiple predicates, for instance, of the form (A OP a₁)where, OP∈{=, ≠, <, ≤, >, ≥, =˜} and A is the variable which may takevalues a₁, a₂ . . . from the range of predicate values corresponding tothe predicate A. This domain may be referred to herein as the dimensiond^(A) of the attribute A, and D can be used to denote the set of alldimensions such that, D={d^(A), d^(B), d^(C) . . . } pe_(i) is used todenote a single predicate statement, and PE is used to denote the set ofall predicate statements such that, PE={pe₁, pe₂, . . . }. The range ofvalues (RHS of a predicate) used by a pe_(i) for a dimension d^(A) isdenoted as R^(A). When evaluating predicate statements, the predicateevaluation function for predicate A under assignment of a single valuea_(i) is denoted as A.eval(a_(i)). The function returns either true orfalse.

One or more preprocessing operations are performed on the collection ofpredicate statements, as shown at block 304. For instance, the one ormore preprocessing operations may include converting predicatestatements to CNF or DNF. Various configurations of the presenttechnology operate on the collection of predicate statements with allpredicate statements either in CNF or DNF. In some instances, some orall of the predicate statements in the collection of predicatestatements may not be in this form. Accordingly, in such instances, atleast a portion of the predicate statements are converted to CNF or DNFsuch at all predicate statements are in CNF or DNF. The process mayemploy any known algorithm to convert a set of arbitrary predicatestatements to either CNF or DNF.

The preprocessing operations may also include assigning a predicatestatement identifier to each predicate statement. This allows eachpredicate statement to be uniquely identified using its predicatestatement identifier. In some configurations, each predicate statementis assigned a sequential number as its predicate statement identifier.However, it should be understood that other approaches for assigningpredicate statement identifiers to predicates statements may be employedwithin the scope of the technology described herein.

The preprocessing operations may further include representing eachpredicate statement is represented as a tree. To represent a predicatestatement as a tree, each predicate from the predicate statement isrepresented as a leaf node, and each logical operator from the predicateis represented as an intermediate node. In some configurations,predicate operators that are negations of the type ‘!=’ are converted toNOT and ‘=’. This eliminates negations from leaf nodes. Relationshipsbetween the nodes in the tree are based on the relationship of theoperators and predicates within the predicate statement.

Each node in the predicate statement may also be assigned a nodeidentifier. In some configurations, the nodes of the tree are numberedusing a depth first walk of the tree. This may include sequentiallyassigning consecutive numbers to each node. However, it should beunderstood that any other number scheme may be used within the scope ofthe technology described herein. The node identifier for a predicateserves to uniquely identify each predicate within that predicatestatement. Each predicate can be uniquely identified within a collectionof predicate statements as a combination of the predicate statementidentifier for the predicate statement of the predicate and thepredicate identifier for the predicate. Thus, a combination of apredicate statement identifier and node identifier serve as a predicateidentifier to uniquely identify a predicate within a collection ofpredicate statements.

FIG. 4 provides an example of a tree 400 generated from the predicatestatement, which is in CNF:

Example pe: (age<25) AND (state=‘CA’ OR state=‘NV’ OR state=‘MA’)

As can be seen in FIG. 4 , each predicate from this example predicatestatement is represented as a leaf node in the tree 400 and each logicaloperator is represented as an intermediate node in the tree 400, withthe relationships among the nodes based on the relationships among thepredicate statements and logical operators in the predicate statement.As also shown in FIG. 4 , each node has been assigned a node identifierusing a depth first walk of the tree using consecutive numbers andstarting with zero.

Returning to FIG. 3 , for each predicate statement, one or moreconjunctive predicates or one or more disjunctive predicates areextracted from the predicate statement to provide a reduced predicatestatements, as shown at block 306. In instances in which the predicatestatements are in CNF, conjunctive predicates are extracted. Ininstances in which the predicate statements are in DNF, disjunctivepredicates are extracted. A predicate is identified as a conjunctivepredicate in a predicate statement if none of the ancestors of thepredicate in the tree expression for the predicate statement are adisjunction. In the example predicate statement used to generate thetree 300 of FIG. 3 , the predicate with the variable “age” is aconjunctive predicate, while the predicates with the variable “state”are not conjunctive predicates. Conversely, a predicate is identified asa disjunctive predicate in a predicate statement if none of theancestors of the predicate in the tree expression for the predicatestatement are a conjunction.

A matrix is generated that includes, for each predicate statement, theone or more conjunctive predicates statements or the one or moredisjunctive predicates extracted from the predicate statement, as shownat block 308. The matrix may comprise a simple tabular structure that isinitialized with one row for each predicate statements and one columnfor each unique variable found in the collection of predicatestatements. As shown at block 310, the reduced predicate statements andmatrix are stored on one or more computer storage media, such that theycan be used to evaluation the predicate statements for querying data.

Any number of transforms may be applied to each predicate statement inorder to extract conjunctive predicates or disjunctive predicates togenerate the matrix and reduced predicate statements. The transforms maybe idempotent, such that evaluation of the matrix and reduced predicatestatement form provide identical results to the evaluation of theoriginal predicate statements. Below are examples of transforms that maybe applied to predicate statements in CNF. While the examples belowfocus on predicate statements in CNF, similar transforms can be appliedto predicate statements in DNF. It should be understood the transformsdescribed below are provided by way of example only and not limitation.None, some, or all of the transforms described herein may be used invarious configurations, while other transforms not described may also beemployed. Any and all variations are contemplated to be within the scopeof the technology described herein.

Transform 1: If a single subexpression within CNF has multipledisjunctions that belong to a common variable, then the disjunctions ofthe common variable are consolidated as a single predicate anddisjunctions are removed. In the Example pe used above to generate thetree 400 of FIG. 4 , the second clause has multiple disjunctions withsame variable “state.” This is replaced by a single predicate as shownbelow:

(state=‘CA’ OR state=‘NV’ OR state=‘MA’) (state=[‘CA’, ‘NV’, ‘MA’]

Thus, the Example pe transforms to:

(age<25) AND state=[‘CA’, ‘NV’, ‘MA’])

If the result of this transform makes the transformed predicate aconjunctive predicate, then it is marked as a conjunctive predicate. Inthe above example, both the predicate with the “age” variable and thepredicate with the “state” variable are conjunctive predicates.

Transform 2: If a CNF has subclauses that are simple predicates of acommon variable and use the inequality operator, then the simplepredicates of the common variable are consolidated as a single predicatewith the inequality operator. By way of example to illustrate:

(age>35 AND country !=‘CANADA’ AND country !=‘USA’)→

(age>35 AND country !=[‘CANADA’, ‘USA’])

If the result of this transform makes the transformed predicate aconjunctive predicate, then it is marked as a conjunctive predicate. Inthe above example, both the predicate with the “age” variable and thepredicate with the “country” variable are conjunctive predicates.

Transform 3: If a given predicate statement pe_(i) does not have anyconjunctive predicate for a given variable, then the predicate statementpe_(i) is augmented with a conjunctive predicate (attribute=Ø), where Øis a phantom value that is considered always present during evaluationsuch that (attribute=Ø) is always true. The newly added predicate ismarked as a conjunctive predicate. For example, take the followingpredicate statement:

pe_(i): (A=a₁) AND (B=b₁ OR C=c₁)

The above example predicate statement pe_(i) does not have conjunctivepredicates for variables B and C. Therefore, the predicate statementpe_(i) is transformed as follows:

pe_(i): (A=a₁) AND (B=b₁ OR C=c₁) AND (B=Ø) AND (C=Ø)

As a result of transforms 1, 2, and 3 each predicate statement has atleast one conjunctive predicate in each dimension.

Transform 4: For each variable of a predicate statement, a most complexconjunctive predicate is selected. Predicate complexity can beconsidered, for instance, from high to low in the following order:

-   -   Predicates transformed in Transform 2; example: (country        !=[‘CANADA’, ‘USX’])    -   Predicates transformed in Transform 1; example: (state=[‘CA’,        ‘NV’, ‘MA’])    -   Simple Predicates; example: (age>25)

If multiple conjunctive predicates of a predicate statement have thesame highest complexity, then one can be selected at random. Theselected predicate for each variable is added to the matrix. Forinstance, each row in the matrix corresponds with a predicate statementand is identified by a predicate statement identifier and each columncorresponds with a variable. The selected predicate for a variable in apredicate is added to the cell matched by predicate identifier: variableas row: column respectively. As an optimization, if the selectedpredicate is a phantom value predicate, then the cell in the matrix ischanged to true. Additionally, the selected predicate removed from theoriginal predicate statement is replaced by the truth value “true.” Asan example to illustrate:

pe_(i): (A=a₁) AND (B=b₁ OR C=c₁) AND (B=Ø) AND (C=Ø)

pe_(i): true AND (B=b₁ OR C=c₁) AND true AND true

Since the removed conjunctive predicates are replaced in this step bytrue. The resultant expression is equivalent to:

⇒pe_(i): True AND (B=b₁ OR C=c₁)

As an optimization, Transform 3, in which conjunctive predicates areadded with a phantom value (variable=Ø) for variables that don't haveconjunctive predicates in predicate statements, can be omitted. Instead,the truth value “true” can be identified in the matrix for any variablethat does not have a conjunctive predicate in a predicate statement.

Transform 5: Each predicate statement pe_(i) is modified with anaddition of a new conjunctive predicate (CJ=pe_(i)), where CJ is a newvariable dimension taking values from the set PE and R^(CJ)=PE={pe₁, pe₂. . . }. The newly introduced predicate (CJ=pe_(i)) is not added tomatrix. As an example to illustrate:

pe_(i): True AND (B=b₁ OR C=c₁)⇒

pe_(i): True AND (B=b₁ OR C=c₁) AND (CJ=pe_(i))

The following discussions provides a specific example of transformsapplied to extract conjunctive predicates to form a matrix and reducedpredicate statements for the following predicate statement set, PE={pe0,pe1, pe2, pe3}, that includes the variables={category, rtb, metro,url_term}:

-   -   pe₀: (category=“iab-51” AND rtb!=4)    -   pe₁: (category=“iab-79” AND (metro=“new york” OR metro=“phoneix”        OR rtb=5)    -   pe₂: ((rtb=1 OR rtb=2) AND (url_term=“cooking” OR        url_term=“finance” OR url_term=“sports”)    -   pe₃: ((metro=‘sjc’ OR metro=‘slc’) AND category !=“iab-13” AND        category !=“iab-80”)

The conjunctive predicates present in the original predicate statementsare marked as bold above. Applying transform 1 results in the followingtransformed predicate statements in which conjunctive predicates arebolded:

-   -   pe₀: (category=“iab-51” AND rtb!=4)    -   pe₁: (category=“iab-79” AND (metro=[“new York,“phoneix”] OR        rtb=5)    -   pe₂: (rtb=[1,2] AND url_term=[“cooking”,“finance”,“sports”])    -   pe₃: (metro=[‘sjc’,‘slc’] AND category !=“iab-13” AND category        !=“iab-80”)

Applying transform 2 results in the following transformed predicatestatements, in which conjunctive predicates are bolded:

-   -   pe₀: (category=“iab-51” AND rtb!=4)    -   pe₁: (category=“iab-79” AND (metro=[“new York,“phoneix”] OR        rtb=5)    -   pe₂: (rtb=[1,2] AND url_term=[“cooking”,“finance”,“sports”])    -   pe₃: (metro=[‘sjc’,‘slc’] AND category !=[“iab-13”,“iab-80”])

Applying transform 3 results in the following transformed predicatestatements, in which conjunctive predicates are bolded:

-   -   pe₀: (category=“iab-51” AND rtb!=4 AND url_term=Ø AND metro=Ø)    -   pe₁: (category=“iab-79” AND (metro=[“new York,“phoneix”] OR        rtb=5) AND url_term=Ø AND rtb=Ø AND metro=Ø)    -   pe₂: (rtb=[1,2] AND url_term=[“cooking”,“finance”,“sports”] AND        metro=ØAND category=Ø)    -   pe₃: (metro=[‘sjc’, ‘slc’] AND category !=[“iab-13”,“iab-80”]        AND url_term=Ø AND rtb=Ø)

Applying transform 4 results in the following matrix and reducedpredicate statements:

Matrix category rtb metro url_term pe₀ category=″iab- rtb!=4 metro=Øurl_term=Ø 51″ pe₁ category=″iab- rtb=Ø metro=Ø url_term=Ø 79″ pe₂category=Ø rtb=[1,2] metro=Ø url_term=[″cooking”,″finance ″,″sports″]pe₃ category != [″iab- rtb=Ø metro=[′sjc′,′slc′ url_term=Ø 13″,″iab-80″]] pe₀:(true AND true AND true AND true) pe₁:(true AND (metro=[″newYork,″phoneix″] OR rtb=5) AND true AND true AND true) pe₂:(true AND trueAND true AND true) pe₃:(true AND true AND true AND true)

Applying transform 5 results in the following matrix and reducedpredicate statements:

Example Matrix category rtb metro url_term pe₀ category=″iab-51″ rtb!=4true true pe₁ category=″iab-79″ true true true pe₂ true rtb=[1,2] trueurl_term=[″cooking”,″finance″, ″sports″] pe₃ category != [″iab- truemetro=[′sjc′,′slc′] true 13″,″iab-80″] pe₀:(CJ = 0) pe₁:(CJ = 1 AND(metro=[″new York,″phoneix″] OR rtb=5) pe₂:(CJ = 2) pe₃:(CJ = 3)Predicate Statement Evaluation

Referring next to FIG. 5 , a flow diagram is provided that illustrates amethod 500 for querying input data by evaluating predicate statementsusing a matrix and reduced predicate statement form for the predicatestatements. The method 500 may be performed, for instance, by theevaluation module 106 of FIG. 1 . As shown at block 502, input data tobe queried is accessed. The input data includes values for any number ofvariables.

As shown at block 504, candidate predicate statements that canpotentially be satisfied by the input data are identified from thematrix. For instance, in cases in which the original predicatestatements were placed in CNF, each row in the matrix includespredicates in each column that are conjunctive with each other, suchthat a predicate statement is identified as a candidate predicate fromthe matrix when each column is true for the input data. As illustratedin the Example Matrix above, a row for a given predicate statement mayhave some columns containing a predicate statement, while other columnsare marked as true as there is no conjunctive predicate for the variableof each of those columns. For instance, for the predicate statement,pe₀, in the Example Matrix, a predicate is identified for the variables“category” and “rtb” while true is indicated for the variables “metro”and “url_term”. Thus, the predicate statement pe₀ is identified as acandidate predicate statement if the predicates in each of the first twocolumns are evaluated to true for the input data. Any predicatestatements that cannot be satisfied based on the matrix can be removedfrom further consideration.

The reduced predicate statement for each candidate predicate statementidentified from the matrix is evaluated for the input data, as shown atblock 506. For each reduced predicate statement that evaluates to truebased on the input data, the corresponding predicate statement is markedas true, thereby providing a result set of predicate statements thatevaluate to true for the input data.

Exemplary Operating Environment

Having described implementations of the present disclosure, an exemplaryoperating environment in which embodiments of the present invention maybe implemented is described below in order to provide a general contextfor various aspects of the present disclosure. Referring initially toFIG. 6 in particular, an exemplary operating environment forimplementing embodiments of the present invention is shown anddesignated generally as computing device 600. Computing device 600 isbut one example of a suitable computing environment and is not intendedto suggest any limitation as to the scope of use or functionality of theinvention. Neither should the computing device 600 be interpreted ashaving any dependency or requirement relating to any one or combinationof components illustrated.

The invention may be described in the general context of computer codeor machine-useable instructions, including computer-executableinstructions such as program modules, being executed by a computer orother machine, such as a personal data assistant or other handhelddevice. Generally, program modules including routines, programs,objects, components, data structures, etc., refer to code that performparticular tasks or implement particular abstract data types. Theinvention may be practiced in a variety of system configurations,including hand-held devices, consumer electronics, general-purposecomputers, more specialty computing devices, etc. The invention may alsobe practiced in distributed computing environments where tasks areperformed by remote-processing devices that are linked through acommunications network.

With reference to FIG. 6 , computing device 600 includes bus 610 thatdirectly or indirectly couples the following devices: memory 612, one ormore processors 614, one or more presentation components 616,input/output (I/O) ports 618, input/output components 620, andillustrative power supply 622. Bus 610 represents what may be one ormore busses (such as an address bus, data bus, or combination thereof).Although the various blocks of FIG. 6 are shown with lines for the sakeof clarity, in reality, delineating various components is not so clear,and metaphorically, the lines would more accurately be grey and fuzzy.For example, one may consider a presentation component such as a displaydevice to be an I/O component. Also, processors have memory. Theinventors recognize that such is the nature of the art, and reiteratethat the diagram of FIG. 6 is merely illustrative of an exemplarycomputing device that can be used in connection with one or moreembodiments of the present invention. Distinction is not made betweensuch categories as “workstation,” “server,” “laptop,” “hand-helddevice,” etc., as all are contemplated within the scope of FIG. 6 andreference to “computing device.”

Computing device 600 typically includes a variety of computer-readablemedia. Computer-readable media can be any available media that can beaccessed by computing device 600 and includes both volatile andnonvolatile media, removable and non-removable media. By way of example,and not limitation, computer-readable media may comprise computerstorage media and communication media. Computer storage media includesboth volatile and nonvolatile, removable and non-removable mediaimplemented in any method or technology for storage of information suchas computer-readable instructions, data structures, program modules orother data. Computer storage media includes, but is not limited to, RAM,ROM, EEPROM, flash memory or other memory technology, CD-ROM, digitalversatile disks (DVD) or other optical disk storage, magnetic cassettes,magnetic tape, magnetic disk storage or other magnetic storage devices,or any other medium which can be used to store the desired informationand which can be accessed by computing device 600. Computer storagemedia does not comprise signals per se. Communication media typicallyembodies computer-readable instructions, data structures, programmodules or other data in a modulated data signal such as a carrier waveor other transport mechanism and includes any information deliverymedia. The term “modulated data signal” means a signal that has one ormore of its characteristics set or changed in such a manner as to encodeinformation in the signal. By way of example, and not limitation,communication media includes wired media such as a wired network ordirect-wired connection, and wireless media such as acoustic, RF,infrared and other wireless media. Combinations of any of the aboveshould also be included within the scope of computer-readable media.

Memory 612 includes computer storage media in the form of volatileand/or nonvolatile memory. The memory may be removable, non-removable,or a combination thereof. Exemplary hardware devices include solid-statememory, hard drives, optical-disc drives, etc. Computing device 600includes one or more processors that read data from various entitiessuch as memory 612 or I/O components 620. Presentation component(s) 616present data indications to a user or other device. Exemplarypresentation components include a display device, speaker, printingcomponent, vibrating component, etc.

I/O ports 618 allow computing device 600 to be logically coupled toother devices including I/O components 620, some of which may be builtin. Illustrative components include a microphone, joystick, game pad,satellite dish, scanner, printer, wireless device, etc. The I/Ocomponents 620 may provide a natural user interface (NUI) that processesair gestures, voice, or other physiological inputs generated by a user.In some instance, inputs may be transmitted to an appropriate networkelement for further processing. A NUI may implement any combination ofspeech recognition, touch and stylus recognition, facial recognition,biometric recognition, gesture recognition both on screen and adjacentto the screen, air gestures, head and eye-tracking, and touchrecognition associated with displays on the computing device 600. Thecomputing device 600 may be equipped with depth cameras, such as,stereoscopic camera systems, infrared camera systems, RGB camerasystems, and combinations of these for gesture detection andrecognition. Additionally, the computing device 600 may be equipped withaccelerometers or gyroscopes that enable detection of motion.

The present invention has been described in relation to particularembodiments, which are intended in all respects to be illustrativerather than restrictive. Alternative embodiments will become apparent tothose of ordinary skill in the art to which the present inventionpertains without departing from its scope.

The subject matter of the present invention is described withspecificity herein to meet statutory requirements. However, thedescription itself is not intended to limit the scope of this patent.Rather, the inventors have contemplated that the claimed subject mattermight also be embodied in other ways, to include different steps orcombinations of steps similar to the ones described in this document, inconjunction with other present or future technologies. Moreover,although the terms “step” and/or “block” may be used herein to connotedifferent elements of methods employed, the terms should not beinterpreted as implying any particular order among or between varioussteps herein disclosed unless and except when the order of individualsteps is explicitly described.

From the foregoing, it will be seen that this invention is one welladapted to attain all the ends and objects set forth above, togetherwith other advantages which are obvious and inherent to the system andmethod. It will be understood that certain features and subcombinationsare of utility and may be employed without reference to other featuresand subcombinations. This is contemplated by and is within the scope ofthe claims.

What is claimed is:
 1. One or more computer storage media storingcomputer-useable instructions that, when used by a computing device,cause the computing device to perform operations, the operationscomprising: accessing a plurality of predicate statements to beevaluated for querying data; generating a set of reduced predicatestatements by extracting one or more conjunctive predicates or one ormore disjunctive predicates from each predicate statement to provide acorresponding reduced predicate statement for each predicate statement;generating a matrix that includes, for each predicate statement, the oneor more conjunctive predicates or the one or more disjunctive predicatesextracted from the predicate statement; storing the set of reducedpredicate statements and the matrix on one or more storage devices;receiving input data comprising a value for each of one or morevariables; and evaluating the plurality of predicate statements for theinput data using the matrix and the set of reduced predicate statements.2. The one or more computer storage media of claim 1, wherein theoperations further comprise performing one or more preprocessingoperations on one or more predicate statements from the plurality ofpredicate statements.
 3. The one or more computer storage media of claim2, wherein the one or more preprocessing operations comprise: convertingthe one or more predicate statements to conjunctive normal form ordisjunctive normal form.
 4. The one or more computer storage media ofclaim 2, wherein the one or more preprocessing operations comprise:generating a tree expression for each predicate statement.
 5. The one ormore computer storage media of claim 1, wherein the reduced predicatestatements and matrix are generated by: applying one or more transformsto at least a portion of the predicate statements.
 6. The one or morecomputer storage media of claim 5, wherein applying the one or moretransforms comprises: identifying a first predicate statement thatincludes multiple disjunctions for a first variable; and consolidatingthe multiple disjunctions as a single predicate and removing themultiple disjunctions from the first predicate statement.
 7. The one ormore computer storage media of claim 5, wherein applying the one or moretransforms comprises: identifying a first predicate statement thatincludes multiple predicates for a first variable that include aninequality operator; and consolidating the multiple predicates as asingle predicate with an inequality operator.
 8. The one or morecomputer storage media of claim 5, wherein applying the one or moretransforms comprises: identifying a first predicate statement that doesnot have a conjunctive predicate for a first variable; and augmentingthe first predicate statement with a conjunctive predicate for the firstvariable that includes an equality operator and a phantom value.
 9. Theone or more computer storage media of claim 1, wherein generating thematrix comprises: adding, for each predicate statement, a true value tothe matrix for any variable not having a conjunctive predicate or adisjunctive predicate in the predicate statement.
 10. The one or morecomputer storage media of claim 1, wherein the matrix comprises a tablein which each row corresponds with a predicate statement from theplurality of predicate statements and each column corresponds with avariable from a plurality of variables included in the plurality ofpredicate statements.
 11. The one or more computer storage media ofclaim 1, wherein evaluating the plurality of predicate statements forthe input data comprises: identifying one or more candidate predicatestatements that can be satisfied for the input data using the matrix;and evaluating the reduced predicate statement for the input data foreach of the one or more candidate predicate statements.
 12. Acomputerized method for querying input data, the method comprising:applying one or more transforms to a plurality of predicate statementsto generate a matrix and a set of reduced predicate statements, thematrix including one or more conjunctive predicates or one or moredisjunctive predicates from each predicate statement from the pluralityof predicate statements, the set of reduced predicate statementsincluding a reduced predicate statement generated for each predicatestatement by removing the one or more conjunctive predicates or the oneor more disjunctive predicates; receiving input data comprising a valuefor each of one or more variables; and evaluating the plurality ofpredicate statements for the input data using the matrix and the set ofreduced predicate statements.
 13. The computerized method of claim 12,wherein the method further comprises converting each of at least aportion of the predicate statements to conjunctive normal form ordisjunctive normal form.
 14. The computerized method of claim 12,wherein applying the one or more transforms comprises: identifying afirst predicate statement that includes multiple disjunctions for afirst variable; and consolidating the multiple disjunctions as a singlepredicate and removing the multiple disjunctions from the firstpredicate statement.
 15. The computerized method of claim 12, applyingthe one or more transforms comprises: identifying a first predicatestatement that includes multiple predicates for a first variable thatinclude an inequality operator; and consolidating the multiplepredicates as a single predicate with an inequality operator.
 16. Thecomputerized method of claim 12, wherein applying the one or moretransforms comprises: identifying a first predicate statement that doesnot have a conjunctive predicate for a first variable; and augmentingthe first predicate statement with a conjunctive predicate for the firstvariable that includes an equality operator and a phantom value.
 17. Thecomputerized method of claim 12, wherein generating the matrixcomprises: adding, for each predicate statement, a true value to thematrix for any variable not having a conjunctive predicate or adisjunctive predicate in the predicate statement.
 18. The computerizedmethod of claim 12, wherein evaluating the plurality of predicatestatements for the input data comprises: identifying one or morecandidate predicate statements that can be satisfied for the input datausing the matrix; and evaluating the reduced predicate statement for theinput data for each of the one or more candidate predicate statements.19. A computer system comprising: one or more processors; and one ormore computer storage media storing computer-useable instructions that,when used by the one or more processors, cause the one or moreprocessors to perform operations comprising: applying one or moretransforms to a plurality of predicate statements to generate a matrixand a set of reduced predicate statements, the matrix including one ormore conjunctive predicates or one or more disjunctive predicates fromeach predicate statement from the plurality of predicate statements, theset of reduced predicate statements including a reduced predicatestatement generated for each predicate statement by removing the one ormore conjunctive predicates or the one or more disjunctive predicates;receiving input data comprising a value for each of one or morevariables; and evaluating the plurality of predicate statements for theinput data using the matrix and the set of reduced predicate statements.